//卸下法宝神器 {"序列":1,"类型":"法宝"}
// @ts-ignore
export async function execute(client_id,message_json) {
    let characters = G.Characters.get_current_login_characters(client_id);
    let type = message_json["类型"];
    let index = message_json["序列"] - 1;

    let target = characters["法宝佩戴"][index];
    // if (target === undefined || target === null) {
    //     ClientUtils.send_basic_prompt(client_id, "该位置未装备");
    //     return;
    // }
    let tmp_target = Object.assign({}, target);
    characters["法宝佩戴"][index] = null;

    if (type === "法宝") {
        //寻找一个空位放入法宝背包
        let spce_index = -1;
        for (let index = 0; index < characters["法宝"].length; index++) {
            const element = characters["法宝"][index];
            if (element === null) {
                spce_index = index;
                break;
            }
        }
        if (spce_index !== -1) {
            characters["法宝"][spce_index] = tmp_target;
        } else {
            characters["法宝"].push(tmp_target);
        }
    }
    if (type === "神器") {
        characters["神器"]["佩戴"] = false;
        characters["神器"]["位置"] = null;
        G.Characters.refrush_fabao_data(characters);
    }
    G.Characters.refrush_fabao_data(characters);

}